package com.jj.fly.utils;

import java.io.IOException;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

import com.google.gson.Gson;
import com.google.gson.JsonObject;

/**
 * 全局工具类
 * 
 * @author JJ
 *
 */
public class WeixinUtils {

	private static final String APPID = "wx7a1c391a10f762c3";
	private static final String APPSECRET = "6c89fb59dffae35bc3766f10b0a698c9";

	/**
	 * 
	 * @param url
	 *            :接口地址
	 * @return
	 */
	public static String doGetStr(String url) {
		DefaultHttpClient httpClient = new DefaultHttpClient();
		HttpGet httpGet = new HttpGet(url);
		JsonObject jsonObject = null;
		Gson gson = new Gson();
		try {
			HttpResponse response = httpClient.execute(httpGet);
			HttpEntity entity = response.getEntity();
			if (entity != null) {
				String result = EntityUtils.toString(entity, "UTF-8");
			}
		} catch (ClientProtocolException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
}
